<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
Class entry_model extends CI_Model {
    public function __construct() {
        parent::__construct();
        $this->load->database();
    }
    
    public function insert($data) {
        $this->db->insert('entry', $data);
        return $this->db->insert_id();
    }
    
    public function get_content($id = null) {
        $this->db->where('id', $id);
        $this->db->where('type', 'knot');
        return $this->db->get('entry')->row_array();
    }
    
    public function update($data = null, $id = null) {
        $this->db->where('id', $id);
        $this->db->set($data);
        $this->db->update('entry');
    }
}
?>
